import request from '@/utils/request'
//显示
export function fetchList(query) {
  return request({
    url: 'https://localhost:44338/api/app/goods',
    method: 'get',
    params: query
  })
}
//添加
export function createArticle(data) {
  return request({
    url: 'https://localhost:44338/api/app/goods',
    method: 'post',
    data
  })
}
//修改
export function updateArticle(data,id) {
  return request({
    url: 'https://localhost:44338/api/app/goods/'+data.id,
    method: 'put',
    data
  })
}
//删除
export function fetchPv(pv) {
  return request({
    url: 'https://localhost:44338/api/app/goods/pv',
    method: 'get',
    params: { pv }
  })
}
//分类显示
export function feetchList(query) {
  return request({
    url: 'https://localhost:44338/api/app/commodity-type',
    method: 'get',
    params: query
  })
}
//两表显示
export function twoList(query) {
  return request({
    url: 'https://localhost:44338/api/app/productl/list',
    method: 'get',
    params: query
  })
}
//修改显示状态
export function feeetchPv(id) {
  return request({
    url: 'https://localhost:44338/api/app/productl/'+id+'/state/',
    method: 'get',
    params: { id }
  })
}
//图片表显示
export function tuList(query) {
  return request({
    url: 'https://localhost:44338/api/app/images/image',
    method: 'get',
    params: query
  })
}
//图片添加
// export function createtuArticletu(data) {
//   return request({
//     url: 'https://localhost:44338/api/app/images/img',
//     method: 'post',
//     data
//   })
// }

//图片添加
export function createimage(data,id) {
  return request({
    url: 'https://localhost:44338/api/app/images/img',
    method: 'post',
    data
  })
}
//图片删除

//修改显示状态
/*export function fetchArticle(id) {
  return request({
    url: 'https://localhost:44338/api/app/commodity-type',
    method: 'get',
    params: { id }
  })
  https://localhost:44338/api/app/productl/3/state
  https://localhost:44338/api/app/images/image
  https://localhost:44338/api/app/images/img
}*/

